import Vue from 'vue'
import Router from 'vue-router'
import Home from '../Home.vue'
import Login from '../views/Login.vue'
import News from '../views/News.vue'
import Types from '../views/Types.vue'
import Test from '../views/Test'
import UserInfo from '../views/UserInfo'
import Business from '../views/BusinessInfo'
import Add from '../views/Add'
import Version from '../views/Version'
import Feedback from '../views/Feedback'
import Type from '../views/Type'
import Phone from '../views/Phone'
import Order from '../views/Order'
import Register from '../views/Register'
import axios from 'axios'
import configg from '../../config/index.js'

Vue.use(Router)
Vue.prototype.BASE_URL = '/api'

const router = new Router({
  routes: [
    {
      path: '/',
      component: Login
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/test', component: Test}
      ]
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/userInfo', component: UserInfo}
      ]
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/add', component: Add}
      ]
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/branchInfo', component: Types}
      ]
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/commInfo', component: News}
      ]
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/businessInfo', component: Business}
      ]
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/versionInfo', component: Version}
      ]
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/feedback', component: Feedback}
      ]
    },
    // {
    //   path: '/home',
    //   component: Home,
    //   children: [
    //     {path: '/type', component: Type}
    //   ]
    // },
    // {
    //   path: '/home',
    //   component: Home,
    //   children: [
    //     {path: '/phone', component: Phone}
    //   ]
    // },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/order', component: Order}
      ]
    },
    {
      path: '/home',
      component: Home,
      children: [
        {path: '/order', component: Order}
      ]
    },
    // {
    //   path: '/home',
    //   component: Home,
    //   children: [
    //     {path: '/registerword', component: Register}
    //   ]
    // },
    {
      path: '/auth/:token',
      component: Home
      // redirect: '/home'
    }
  ]
})
export default router
